home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROCS.ZIP
/
GMEAN.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
712b
|
29 lines
############################################################################
#
# File: gmean.icn
#
# Subject: Procedure to compute geometric mean
#
# Author: Gregg M. Townsend
#
# Date: November 10, 1990
#
###########################################################################
#
# This procedure computes the geometric mean of an arbitrary number of
# values. It fails if there are no arguments or if any argument is zero.
#
############################################################################
procedure gmean(L[])
local m
m := 1.0
every m *:= !L
m := abs(m)
if m > 0.0 & *L > 0 then
return exp (log(m) / *L)
else
fail
end